#!/bin/sh
. ../testfuncs.sh

set -e
testname=`basename $0 .test`

./cmdln_parse -a foobar > $testname.out 2>&1 && exit 1
./cmdln_parse -a 42 -noarg >> $testname.out 2>&1 && exit 1
./cmdln_parse -a 42 -c >> $testname.out 2>&1 && exit 1

sed -ne 's,^ERROR:.*line [0-9]*:,ERROR:,p' < $testname.out > $testname.tmp.out \
    && mv $testname.tmp.out $testname.out
compare_table defaults $testname.out $tests/unit/test_cmdln/$testname.res 100
#rm -f $testname.out
